﻿using Inovout.AccessControl.Web.Models;
using Inovout.Cloud.Web.Http;
using System.Web.Http;

namespace Inovout.AccessControl.Web.Controllers
{
    public class CheckController : CloudHttpController
    {
        [Route("{*pathInfo}")]
        [HttpGet, HttpPost, HttpDelete, HttpPut, HttpOptions]
        public IdentityInfo Do()
        {

            return new IdentityInfo
            {
                MembershipIdentifier = MembershipUser.Name,
                ApplicationIdentifier = ApplicationUser.Name,
                MembershipIdentifierCode = MembershipUser.IdentifierCode,
                ApplicationIdentifierCode = ApplicationIdentifier
            };
        }
        protected override Memberships.Models.Membership GetDataOwner()
        {
            return base.GetDataOwner() ?? (Membership as Memberships.Models.Membership);
        }
    }
}
